//
//  HYBaseHandler.m
//  Around
//
//  Created by 华谕 on 2017/6/13.
//  Copyright © 2017年 HUYU. All rights reserved.
//

#import "HYBaseHandler.h"

@implementation HYBaseHandler

//注册请求验证码/user/code4register
+ (void)requestCodeRegisterParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_CodeRegister params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//用户注册
+ (void)requestRegisterParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_Register params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//地区/c/area/findAll
+ (void)requestAreaParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_areaList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//登录/c/userLogin/login
+ (void)requestUserLoginParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_UserLogin params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//退出登录 /c/userLogin/logout
+ (void)requestUserLogoutParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_UserLogout params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

// /c/userLogin/updatePsw 修改密码, [type]{2：忘记密码，3：修改密码，4：修改支付密码：5：修改回购密码
+ (void)requestUpdatePswParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_updatePsw params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//用户信息 /c/user/userInfo
+ (void)requestGetUserInfoParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_userInfo params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//修改用户信息 
+ (void)requestUpdateInfoParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_updateInfo params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//修改手机号/c/user/updatePhone
+ (void)requestUpdatePhoneParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_updatePhone params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//账单列表
+ (void)requestUserWalletInfoListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_userWalletInfo params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//文件上传 /c/file/upload
+ (void)requestFileUploadParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
//    [HttpTool postWithPath:SERVER_fileUpload params:parmers success:^(id json) {
//        success(json);
//    } failure:^(NSError *error) {
//        failed(error);
//
//    }];
}

//银行卡列表 /c/bankCard/findAll
+ (void)requestBankCarListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_BankCarList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//银行列表 /c/bank/findAll
+ (void)requestBankListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_BankList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//添加银行卡 /c/bankCard/add
+ (void)requestAddBankCarParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_AddBankCar params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//新增地址 /c/address/save
+ (void)requestSaveAddressParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_SaveAddress params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//地址列表 /c/address/findAll
+ (void)requestAddressListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_AddressList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//设为默认 /c/address/setDefault
+ (void)requestAddresssetDefaultParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_AddsetDefault params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//删除 /c/address/delete
+ (void)requestAddressDeleteParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_AddressDelete params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//分销统计 /c/distribution/myDistribution
+ (void)requestMyDistrionParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_myDistrion params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//消息反馈 /c/msgFeedback/save
+ (void)requestmsgFeedbackParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_Feedbacksave params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//分销成员列表 /c/distribution/memberDistribution
+ (void)requestDistriListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_DistriList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//通用设置 /c/systemConfig/findByKey
+ (void)requestSystemConfigParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_systemConfig params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//技术区首页 /c/homePage/technology
+ (void)requestTechnologyHomeParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_TechnologyHome params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//协议 /c/agreement/findAll
+ (void)requestagreementParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_agreement params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//体验馆 /c/experienceShop/findAll
+ (void)requestExperienceShopParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_experienceShop params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//递送需求 /c/deliveryDemand/create
+ (void)requestDeliveryDemandParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_delivery params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//技术区商品分类 /c/productType/findAll
+ (void)requestProductTypeParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_productType params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//技术区商品详情 /c/product/select
+ (void)requestProductSelectParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_productSelect params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//添加到购物车或修改 /c/shoppingCart/save
+ (void)requestAddShoppingCartParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_AddshoppingCart params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//购物车列表 /c/shoppingCart/page
+ (void)requestShoppingCartListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_ShoppingCartList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//购物车删除 /c/shoppingCart/deleteByIds
+ (void)requestShoppingCartDeleteParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_ShoppingCartDelete params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//下单 /c/orderMaster/create
+ (void)requestOrderMasterParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_OrderMaster params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

// 催促发货
+ (void)requestOrderUrgeDeliverParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_OrderUrgeDeliver params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//支付 /c/walletPay/oneIntegralPay
+ (void)requestWalletPayParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_WalletPay params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//计算价格 /c/orderMaster/calPrice
+ (void)requestCalPricParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_CalPrice params:parmers success:^(id json)
    {
        success(json);
    } failure:^(NSError *error)
    {
        failed(error);
    }];
}

//订单列表 /c/orderMaster/page
+ (void)requestOrderListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_OrderList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//取消订单 /c/orderMaster/cancel
+ (void)requestOrderCancelParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_OrderCancel params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//确认订单 /c/orderMaster/confirm
+ (void)requestOrderSoureParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_OrderSoure params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//公钥 /c/rsaKey/publicKey
+ (void)requestPublicKeyParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_PublicKey params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//默认邀请码 /c/systemConfig/findByKey
+ (void)requestFindByKeyParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_findByKey params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//支付
+ (void)requestPayParmers:(NSDictionary *)parmers PayType:(NSInteger)payType Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    NSString *url = @"/c/wechatPay/appPayInfo";
    if (payType == 1)
    {
        url = @"/c/aliPay/appPayInfo";
    }
    [HttpTool postWithPath:url params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//充值 /c/recharge/create
+ (void)requestRechargeCreatParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_recharge params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//钱包 SERVER_walletInfo
+ (void)requestUserWalletParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_walletInfo params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//提现 /c/withdraw/withdraw
+ (void)requestUserWithdrawParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_Userwithdraw params:parmers success:^(id json)
     {
         success(json);
     } failure:^(NSError *error)
     {
         failed(error);
     }];
}

//二维码 /c/qrCode/userRegQrCode
+ (void)requestUserRegQrCodeParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_userRegQrCode params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//生活区 /c/homePage/life
+ (void)requestLifeHomePageParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_LifeHomePage params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

// 商品列表
+ (void)requestLifeGoodsListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_LifeGoodsList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//小分类 /c/productType/findAll
+ (void)requestLifeproductTypeParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_LifeproductType params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//商品所有小分类 /c/product/byParentProductTypeId
+ (void)requestLifeByParentProductTypeIdParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_LifeAllsmollType params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//商品搜索
+ (void)requestGoodsSearchParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_goodsSearch params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//数量提醒 /c/orderMaster/numRemind
+ (void)requestOrdernumRemindParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_numRemind params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//查看物流 /c/orderMaster/expressInfo
+ (void)requestOrderExpressInfoParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_ExpressInfo params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//申请退款 /c/refund/confirm
+ (void)requestOrderRefundConfirmParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_refundConfirm params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//银行卡删除
+ (void)requestBankCarDeleteParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_bankCarDelete params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//消息列表 /c/msgPush/page
+ (void)requestMsgPushParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_msgPush params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//支付通道 /c/paymentChannel/create
+ (void)requestPaymentChannelParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:SERVER_paymentChannel params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//审核 /c/freeLogin/iosCheckVersionPass 
+ (void)requestCheckVersionParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_CheckVersion params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//通用表单
+ (void)requestWithTheFormUrl:(NSString *)url Parmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//通用Json
+ (void)requestWithJsonUrl:(NSString *)url Parmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:url params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

@end
